/* 
Scenic Graphics Library
Copyright (C) 2007 Jouni Tulkki

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USApackage scenic;
*/

package scenic;

import scenic.filter.Filter;
import scenic.jni.Renderer;

class DrawContext implements Cloneable {
	public Device device;
	public SceneParent root;
	public Object renderingInstance;
	public int context;
	public int width;
	public int height;
	public Renderer renderer;
	public int surfaceType = Renderer.SURFACE_TYPE_COLOR;
	public Filter AAFilter;

	public DrawContext() {		
	}

	public DrawContext(DrawContext context, int surfaceType) {
		this.renderingInstance = context.renderingInstance;
		this.root = context.root;
		this.device = context.device;
		this.context = context.context;
		this.width = context.width;
		this.height = context.height;
		this.renderer = context.renderer;
		this.surfaceType = surfaceType;
		this.AAFilter = context.AAFilter;
	}
	
	public DrawContext clone() {
		try {
			return (DrawContext)super.clone();
		} catch(CloneNotSupportedException e) {
				return null;
		}
	}
	
	public boolean usesCustomAAFilter() {
		return AAFilter != null && AAFilter != SceneSettings.getDefaultAAFilter();
	}
	
}
